Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Continued from the above discussion, I draft the following codes to form a Bow-based feature representation. I try to use three feature descriptors to extract the keypoints of characters. And then use Hog feature descriptors to describe these keypoints for the further training in Bow and SVM.
- vector<Point2f> pts1,pts2,pts3;
- ORB detector1;
- vector<KeyPoint> keypoints1;
- detector1.detect(src, keypoints1);
- keyPointsToPoints(keypoints1, pts1);
- GoodFeaturesToTrackDetector detector2;
- vector<KeyPoint> keypoints2;
- detector2.detect(src, keypoints2);
- keyPointsToPoints(keypoints2, pts2);
- DenseFeatureDetector detector3;
- vector<KeyPoint> keypoints3;
- detector3.detect(src, keypoints3);
- keyPointsToPoints(keypoints3, pts3);
- vector<float> descriptors1,descriptors2,descriptors3;
- HOGDescriptor hog;
- hog.compute(src,descriptors1,Size(3,3),Size(1,1),pts1);
- hog.compute(src,descriptors2,Size(3,3),Size(1,1),pts2);
- hog.compute(src,descriptors3,Size(3,3),Size(1,1),pts3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement